﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using dbutility;
using DBUtility;
using System.Collections.Generic;

namespace hf.DAL
{
    public class IPAddress
    {
        public IPAddress()
		{}
        /// <summary>
        /// 得到列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageNumber"></param>
        /// <param name="strWhere"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public List<hf.Model.IPAddress> GetIPAddressList(int PageSize, int PageNumber, string strWhere, out int total)
        {
            DataSet ds = PageHelper.GetList(PageSize, PageNumber, "tb_IPAddress", "ID", strWhere, out total);
            //实例化列表
            List<hf.Model.IPAddress> list = new List<hf.Model.IPAddress>();
            //判断ds是不是空的
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    //把datatable转换成对象
                    hf.Model.IPAddress m = DBHelperSQL.SetModel<hf.Model.IPAddress>(dr);
                    if (m != null)
                        list.Add(m);
                }
            }
            return list;
        }
    }
}
